<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
        $question=M('test');
        $list=$question->limit(5)->select();
        $this->assign('data',$list);
        if(session('username')){
        }else{
            redirect(U('/Home/Login/index'),0,'重新登录');
        }
        $this->display();
    }
    public function exam($id){
        if(session('username')){
            redirect(U('/Home/Exam/index',array('id'=>$id)),0,'开始考试');
        }else{
            redirect(U('/Home/Login/index'),0,'重新登录');
        }
    }
}